home *** CD-ROM | disk | FTP | other *** search
- unit UPTImageCombo; // Copyright ⌐ 1996-2001 Plasmatech Software Design. All rights reserved.
- {
- Shell Control Pack
- Version 1.6
-
- History
- ===================================================================================================
- V1.6 2Jul01 Delphi 6 release, no changes.
- V1.5c 30Mar01 No changes.
- V1.5b 12Dec00 No changes.
- V1.5a 14May00 No changes.
- V1.5 3Mar00 C++Builder 5 release.
- Added OnGetItemData event to TPTImageCombo which works like a 'virtual mode' for
- the combo item data.
- V1.4a 15Dec99 Published OnContextPopup for Delphi 5.
- V1.4 14Sep99 Minor changes to support Delphi 5.
- V1.3h 29Mar99 Fixed problem where TPTImageCombo wouldn't draw its background using the Color
- property. It would always use clWindow.
- V1.3g 1Dec98 No changes.
- V1.3f 12Jul98 Minor changes to support Delphi 4.
- V1.3e 22Apr98 No changes.
- V1.3d 18Apr98 No changes.
- V1.3c 16Mar98 Slight changes to method ordering in item destruction.
- V1.3b 7Feb98 Added Index property to TPTImageComboItem.
- V1.3a 7Jan98 No changes.
- V1.3 28Nov97 Added AutoSizeHeight property to TPTCustomImageCombo.
- Added WM_SETFONT handling for image combo. Image based combos now change height
- with different font sizes.
- Added better design-time handling of change ItemHeight property.
- Changed icon drawing in image combo - image is now centered vertically.
- Fixed bug with TPTImageCombo which would cause AV's when no ImageList property
- was assigned.
- V1.2b 12Oct97 No significant changes.
- V1.2a 5Oct97 No changes.
- V1.2 6Sep97 No changes.
- V1.1a 6Jul97 No changes.
- V1.1 26Jun97 Changes to OnDeleteItem.
- V1.0c 31May97 No changes.
- V1.0b 17May97 Delphi 3 support.
- V1.0a 1May97 No changes.
- V1.0 21Apr97 Released version 1.0
- }
-
- {$INCLUDE PTCompVer.inc}
-
- {$RANGECHECKS OFF} {$OVERFLOWCHECKS OFF} {$WRITEABLECONST OFF}
- {$BOOLEVAL OFF} {$EXTENDEDSYNTAX ON} {$TYPEDADDRESS ON}
-
- interface
- uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
- {$IFDEF VCL40PLUS}
- ImgList,
- {$ENDIF}
- StdCtrls;
-
- { $DEFINE PTDEBUG} // <-- Define this symbol to turn on leak checking
-
- type//-- Classes
- TPTImageComboItem = class;
-
- //-- Components
- TPTCombobox = class;
- TPTCustomImageCombo = class;
- TPTImageCombo = class;
-
-
- TPTImageComboItem = class
- protected
- mOwner: TPTCustomImageCombo;
- mItemIndex: Integer;
-
- mIndex: Integer;
- mIndent: Integer;
- mImageIndex: Integer;
- mOverlayIndex: Integer;
- mCaption: String;
- mTag: Integer;
- mData: Pointer;
-
- procedure SetIndent( aValue: Integer );
- procedure SetImageIndex( aValue: Integer );
- procedure SetCaption( const aValue: String );
- procedure SetOverlayIndex( aValue: Integer );
-
- public
- constructor Create( aOwner: TPTCustomImageCombo );
- destructor Destroy; override;
-
- property Index: Integer read mIndex; // Index in the list of the owning combobox
- property Indent: Integer read mIndent write SetIndent;
- property ImageIndex: Integer read mImageIndex write SetImageIndex;
- property OverlayIndex: Integer read mOverlayIndex write SetOverlayIndex;
- property Caption: String read mCaption write SetCaption;
- property Data: Pointer read mData write mData; // User defined information
- property Tag: Integer read mTag write mTag; // User defined information
- end; {TPTImageComboItem}
-
-
- TPTDeleteComboItemEvent = procedure( aSender: TObject; aItem: Pointer ) of object;
-
- TPTCustomCombobox = class(TCustomCombobox)
- end; {TPTCustomCombobox}
-
-
- TPTCombobox = class(TPTCustomCombobox)
- published
- // -- Normal combobox properites
- property Style; {Must be published before Items}
- property Color;
- property Ctl3D;
- property DragMode;
- property DragCursor;
- property DropDownCount;
- property Enabled;
- property Font;
- property ItemHeight;
- property Items;
- property MaxLength;
- property ParentColor;
- property ParentCtl3D;
- property ParentFont;
- property ParentShowHint;
- property PopupMenu;
- property ShowHint;
- property Sorted;
- property TabOrder;
- property TabStop;
- property Text;
- property Visible;
- property OnChange;
- property OnClick;
- property OnDblClick;
- property OnDragDrop;
- property OnDragOver;
- property OnDrawItem;
- property OnDropDown;
- property OnEndDrag;
- property OnEnter;
- property OnExit;
- property OnKeyDown;
- property OnKeyPress;
- property OnKeyUp;
- property OnMeasureItem;
- property OnStartDrag;
- // -- Added by TPTCustomCombobox
- property OnDeleteItem;
- property OnCloseUp;
- property OnSelEndCancel;
- property OnSelEndOk;
- {$IFDEF VCL40PLUS}
- property Anchors;
- property Constraints;
- property DragKind;
- property ImeMode;
- property ImeName;
- property BiDiMode;
- property ParentBiDiMode;
- property OnEndDock;
- property OnStartDock;
- {$ENDIF}
- {$IFDEF VCL50PLUS}
- property OnContextPopup;
- {$ENDIF}
- end; {TPTCombobox}
-
- TPTDeleteImageComboItemEvent = procedure( aSender: TObject; aItem: TPTImageComboItem ) of object;
- TPTImageComboGetItemDataEvent = procedure( aSender: TObject; aItem: TPTImageComboItem ) of object;
-
- TPTCustomImageCombo = class(TPTCustomCombobox)
- public
- constructor Create( aOwner: TComponent ); override;
- destructor Destroy; override;
-
- function AddItem( aCaption: String; aImageIndex: Integer; aIndent: Integer ): TPTImageComboItem; {$IFDEF VCL60PLUS} reintroduce; {$ENDIF} virtual;
- property ImageComboItem[index: Integer]: TPTImageComboItem read GetImageComboItem;
- end; {TPTCustomImageCombo}
-
-
- TPTImageCombo = class(TPTCustomImageCombo)
- published
- property AutoSizeHeight;
- property IndentPixels;
- property ImageList;
- property OnDeleteItem;
- property OnCloseUp;
- property OnSelEndCancel;
- property OnSelEndOk;
- property OnGetItemData;
- // -- Normal combobox properties
- property Color;
- property Ctl3D;
- property DragMode;
- property DragCursor;
- property DropDownCount;
- property Enabled;
- property Font;
- property ItemHeight;
- property MaxLength;
- property ParentColor;
- property ParentCtl3D;
- property ParentFont;
- property ParentShowHint;
- property PopupMenu;
- property ShowHint;
- property Sorted;
- property TabOrder;
- property TabStop;
- property Visible;
- property OnChange;
- property OnClick;
- property OnDblClick;
- property OnDragDrop;
- property OnDragOver;
- property OnDrawItem;
- property OnDropDown;
- property OnEndDrag;
- property OnEnter;
- property OnExit;
- property OnKeyDown;
- property OnKeyPress;
- property OnKeyUp;
- property OnMeasureItem;
- property OnStartDrag;
- {$IFDEF VCL40PLUS}
- property Anchors;
- property Constraints;
- property DragKind;
- property ImeMode;
- property ImeName;
- property BiDiMode;
- property ParentBiDiMode;
- property OnEndDock;
- property OnStartDock;
- {$ENDIF}
- {$IFDEF VCL50PLUS}
- property OnContextPopup;
- {$ENDIF}
- end; {TPTImageCombo}
-
-
- {*****************************************************************************}
- implementation
-